import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Index from '@/views/Index'
import Yy from '@/views/yingyuan/Yy'
import Yc from '@/views/yanchu/Yc'
import Sy from '@/views/shouye/Sy'
import Ct from '@/views/center/Ct'
import Dd from '@/views/center/dingdan/Dd'
import Xx from '@/views/center/xinxi/Xx'
import Buy from '@/views/yanchu/Buy'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'login',
    component: Login
  },
  {
    name: "index",
    path: "/index",
    component: Index,
    children: [
      {
        name: "yy",
        path: "yy",
        component: Yy,
      },
      {
        name: "yc",
        path: "yc",
        component: Yc,
      },
      {
        name: "buy",
        path: "buy",
        component: Buy,
      },
      {
        name: "sy",
        path: "sy",
        component: Sy,
      },
      {
        name: "ct",
        path: "ct",
        component: Ct,
        children: [
          {
            name: "dd",
            path: "dd",
            component: Dd,
          },
          {
            name: "xx",
            path: "xx",
            component: Xx,
          },
        ]
      },
    ]
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
